//
//  main.cpp
//  debug_zen
//
//  Created by lover on 2019/11/29.
//  Copyright © 2019 lover. All rights reserved.
//

#include <iostream>
#include <string>
#include "zen_exception.h"
#include "zen_buffer.h"
#include "zen_cast.h"
#include "config.h"

struct Data {
	char c1, c2;
};

void buffer_debug() {

	std::stringstream ss;
	ss.str("hellloworld");
	cout << ss.str() << endl;

	Zen::Buffer buffer;
	buffer.write("hello", 5);
	std::cout << buffer.size() << std::endl;
	buffer.write("world", 5);
	std::cout << buffer.size() << std::endl;
	std::cout << Zen::ToString(buffer.data()) << std::endl;
	buffer.seekp(6, std::ios::beg);
	buffer.write("lalalal", 6);
	std::cout << buffer.size() << std::endl;
	std::cout << Zen::ToString(buffer.data()) << std::endl;

	Data a;
	buffer.read(a);
	buffer.seekg(3, std::ios::cur);
	std::cout << a.c1 << a.c2 << std::endl;
//	std::cout << buffer.position() << std::endl;
}
